import React from 'react';
import classNames from 'classnames';
import {FontAwesomeIcon, FontAwesomeIconProps} from '@fortawesome/react-fontawesome';

export type ThemeProps = 'primary' | 'success' | 'info' | 'danger' | 'secondary' | 'warning' | 'light' | 'dark';

export interface IconProps extends FontAwesomeIconProps {
    theme?: ThemeProps
};

export const Icon: React.FC<IconProps> = (props) => {
    const {className, theme, ...restProps} = props;
    const classes = classNames('viking-icon', className, {
        [`icon-${theme}`] : theme
    });
    return (<FontAwesomeIcon className={classes} {...restProps} />)
}

export default Icon;